package day5.string;

import java.util.Arrays;

/**
 * @author joker
 * @date 2022/4/15 0015 - 22:46
 */
public class StringTest6 {
    public static void main(String[] args) {
        String str1="asvddasfcsdvdfvbdfbfdvd";
        String str2="vd";
//        String str3=str1.replace("vd","1");
//        int num=str3.length()-str1.length();
//        System.out.println(num);
        String[] str3=str1.split("vd");
        System.out.println(Arrays.toString(str3));
        if (str1.endsWith("vd")){
            System.out.println(str3.length);
        }else {
            System.out.println(str3.length-1);
        }
    }
}
